<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupScrollBox</title>

<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-size: large;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupFlatScrollBox<span class="style1"> (since 3.22)</span></h2>
<p>Creates a native container that allows its child to be scrolled. It inherits from
  <a href="../elem/iupcanvas.html">IupCanvas</a>. The difference from
<a href="iupscrollbox.html">IupScrollBox</a> is that its scrollbars are drawn.</p>

<h3><a name="Creation">Creation</a></h3>

<pre>Ihandle* IupFlatScrollBox(Ihandle*<strong> child</strong>); [in C]
iup.flatscrollbox{<strong>child</strong>: ihandle} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
flatscrollbox(<strong>child</strong>) [in LED]</pre>
  <p><strong>child</strong>: Identifier of an interface element which will 
  receive the box. It can be NULL (nil in Lua), or empty in LED.</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p>Inherits all attributes and callbacks of the <a href="../elem/iupcanvas.html">IupCanvas</a>, 
but redefines a few attributes.</p>
<p><a href="../attrib/iup_bgcolor.html">BGCOLOR</a>: will always use the 
background color of the native parent.</p>

<p><b>BORDER </b>(creation only):
  
  it is always "NO".</p>

<p>
<strong>CANFOCUS</strong>: 
is set to NO.</p>

<p>
<font SIZE="3">
	<strong>CANVASBOX</strong> (non inheritable): enable the behavior of a 
canvas box instead of a regular container. This will affect the EXPAND 
attribute, the Natural size computation, and child layout distribution. Can be Yes or No. Default: No. </font></p>

<p><strong>CHILDOFFSET</strong>: Allow to specify a position offset for the 
child. Available for native containers only. It will not affect the natural 
size, and allows to position controls outside the client area. Format &quot;<em>dx</em>x<em>dy</em>&quot;,
  where <em>dx</em> and <em>dy</em> are integer values corresponding to the 
horizontal and vertical offsets, respectively, in pixels. Default: 0x0.</p>

<p><a href="../attrib/iup_expand.html">EXPAND</a> (<font SIZE="3">non inheritable</font>):
  The default value is &quot;YES&quot;.</p>
<p><strong>LAYOUTDRAG</strong> (<font SIZE="3">non inheritable</font>): When the 
scrollbar is moved automatically update the children layout. Default: YES. If 
set to NO then the layout will be updated only when the mouse drag is released.</p>
<p><a href="../attrib/iup_scrollbar.html">SCROLLBAR</a> (read-only): is always "NO". So the IupCanvas 
native scrollbars are hidden. See the FLATSCROLLBAR attribute bellow. YAUTOHIDE and XAUTOHIDE will be always Yes.</p>
<p>
<font SIZE="3">
	<strong>SCROLLTO</strong> (write-only): position the scroll at the given x,y 
coordinates relative to the box top-left corner. Format &quot;<em>x,y</em>&quot;. 
Value can also be TOP or BOTTOM for a vertical scroll to the top or to the 
bottom of the scroll range.</font></p>
<p><font SIZE="3">
	<strong>SCROLLTOCHILD</strong> (write-only): position the scroll at the 
top-left corner of the given child located by its name. Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
associate an Ihandle* to a name. The child must be contained in the Scrollbox 
hierarchy.</font></p>
<p><font SIZE="3">
	<strong>SCROLLTOCHILD_HANDLE</strong> (write-only): same as SCROLLTOCHILD 
but directly using the child handle.</font></p>
<p> <a href="../attrib/iup_flatscrollbar.html">FLATSCROLLBAR</a>: Can be Yes, 
Vertical or Horizontal. Can be set only before map. Default: Yes. </p>
<p> <strong>WHEELDROPFOCUS: </strong>set to Yes. (since 3.28)</p>
<h3>Scrollbars Appearance Attributes</h3>
<p>See <a href="../attrib/iup_flatscrollbar.html">FLATSCROLLBAR</a>.</p>

  <blockquote>
    <hr>
</blockquote>

  <p>
  <a href="../attrib/iup_clientsize.html">CLIENTSIZE</a>, 
	<a href="../attrib/iup_clientoffset.html">CLIENTOFFSET</a>: 
also accepted.</p>

<h3><a name="Callbacks">Callbacks</a></h3>

<p><strong>LAYOUTUPDATE_CB</strong>: Action generated when the layout is updated 
after a scroll operation. (since 3.24)</p>

<h3>Notes</h3>
<p>The box allows the application to create a virtual space for the dialog that 
is actually larger than the visible area. The current size of the box defines 
the visible area. The natural size of the child (and its children) defines 
the virtual space size. </p>
<p>So the <strong>IupFlatScrollBox</strong> does not depend on its child size or 
expansion, and its natural size is always 0x0, except for the first time when it 
expands to the child natural size. </p>
<p>The user can move the box contents by dragging the background. Also the mouse 
wheel scrolls the contents vertically.</p>

<p>The box can be created with no elements and be dynamic filled using
  <a href="../func/iupappend.html">IupAppend</a> or
<a href="../func/iupinsert.html">IupInsert</a>.</p>
<p>Notice that it is possible to use the <strong>IupFlatScrollBox</strong> to 
overcome the internal scrollbars of another control like <strong>IupMatrix</strong> 
by making all cells visible, but this will force all cells to be drawn all the 
time even when not visible at the scroll box, which is much slower than the 
internal <strong>IupMatrix</strong> optimization.</p>


<h3><a name="Examples">Examples</a></h3>
<p><a href="../../examples/">Browse for Example Files</a></p>

<div align="center">
  <center>
  <img border="0" src="images/iupflatscrollbox.png">
  </center>
</div>

</body>

</html>
